
 /**
 * IUserManager.java.java.
 * User: BrianChen Date: 2012-6-5 下午04:53:17
 *
 * Copyright (c) 2009 Hewlett-Packard Development Company, L.P.
 * All rights reserved.
 */
package com.collapsar.core.security.service;

import java.io.File;

import com.collapsar.core.orm.page.Page;
import com.collapsar.core.security.model.User;
import com.collapsar.core.security.model.UserInfo;
import com.collapsar.core.service.IManager;

/**
 * <pre>
 * REVISIONS: 
 * Version 	Date 		Author 			Description
 * ------------------------------------------------------------------- 
 * 1.0 		2012-6-5 	BrianChen 	1. Created this class. 
 * </pre>
 * 
 * @author BrianChen
 * @date 2012-6-5 下午04:53:17
 * @version 1.0
 * @see
 * 
 */
public interface IUserManager extends IManager{
	/**
	 * 用户登录
	 * @param account
	 * @param passwd
	 * @return
	 */
	boolean login(String account, String passwd);
	static final String L_USER_NOT_EXIST = "该用户不存在~！";
	static final String L_USER_PWD_WRONG= "密码错误~！";
	static final String L_USER_DISABLE = "该用户未激活~！";
	
	/**
	 * 用户注册
	 * @param user
	 * @return
	 */
	boolean regist(User user);
	static final String R_USER_EXIST = "该用户已经存在";
	
	/**
	 * 查询所有用户
	 * @param offset
	 * @param pageSize
	 * @return
	 */
	Page<User> queryAllUsers(int offset, int pageSize);
	
	/**
	 * 删除指定用户
	 * @param userId
	 * @return
	 */
	boolean deleteUser(Long userId);
	
	/**
	 * 查询用户详情信息
	 * @param userInfoId
	 * @return
	 */
	UserInfo queryUserInfo(Long userInfoId);
	/**
	 * 根据用户帐号查询用户信息
	 * @param userAccount
	 * @return
	 */
	UserInfo queryUserInfoByUserAccount(String userAccount);
	
	/**
	 * 更新用户信息
	 * @param userInfo
	 * @param uploadFile
	 * @return
	 */
	boolean modifyUserInfo(UserInfo userInfo, File uploadFile);
	
	
	
	public abstract void deleteUser(User user);
	public abstract void deleteAllUsers(Long userIds[]);
	
	
	public abstract User loadUser(Long userId);	
//	public abstract User loadUserWithGroupsAndRoles(Long userId);
	public abstract User getUserByAccount(String userAccount);

}

